package lab02.Test23;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Scanner;

/**
 * Created by lenovo on 2017/11/2.
 */
public class test01 {
    public static void main(String[] args) throws ParseException {
        //键盘输入生日
        Scanner scanner=new Scanner(System.in);
        String birthday;
        birthday=scanner.nextLine();
        //生日还有几天   生日期-当前日期  1000毫秒=1秒
        //（time1-time2）/(24*60*1000)
        //日期->整数？？？ simpleDATEFORMAT CALENDAR 日历
        SimpleDateFormat simpleDateFormat=new SimpleDateFormat("yyy-mm-dd");
        Calendar calendar= Calendar.getInstance();
        long time1=0;
        long time2=0;
        calendar.setTime(simpleDateFormat.parse(birthday));
        time1=calendar.getTimeInMillis();
        calendar.setTime(simpleDateFormat.parse("2017-11-02"));
        time2=calendar.getTimeInMillis();
        System.out.println("相差天数："+(time1-time2)/(24*60*60*1000));
        //生日是星期几
    }
}
